import { RouteRecordRaw } from "vue-router"
import  NavBar from "@/components/nav-bar/index.vue"
import  TabBar from "@/components/Tab-bar/index.vue"
import { Tab } from "vant"


// 路由表配置数组 
const routes :RouteRecordRaw []  = [
    {
        path:"/",
        redirect:"./home",//重定向

    },
    {
        path:"/home",
        // component:() =>import("../views/home/index.vue") ,  
        components:{ //命名出口视图配置 
            // header:NavBar,
            default:() =>import("../views/home/index.vue"), 
            footer:TabBar,
        },
        meta:{
            title:"首页",
            icon:"home-o",
            inTabbar:true, //标记当前项是需要造tabbar上渲染的
        }
    },
    {
        path:"/category",
        components:{  
            header:NavBar,
            default:() =>import("../views/category/index.vue"), 
            footer:TabBar,
        },
        meta:{
            title:"分类",
            icon:"list-switch",
            inTabbar:true,
        }
    },
    {
        path:"/cart",
        components:{  
            header:NavBar,
            default:() =>import("../views/cart/index.vue"), 
            footer:TabBar,
        },
        meta:{
            title:"购物车",
            icon:"shopping-cart-o",
            inTabbar:true,
        }
    },
    {
        path:"/mine",
        components:{  
            header:NavBar,
            default:() =>import("../views/mine/index.vue"), 
            footer:TabBar,
        },
        meta:{
            title:"我的",
            icon:"user-o",
            inTabbar:true,
        }
    },
    {
        path:"/login",
        components:{
            header:NavBar,
            default:() =>import("../views/home/index.vue"),
        },
        meta:{
            title:"用户登录",
           
        }
    },
    {
        path:"/list",
        components:{
            header:NavBar,
            default:() =>import("../views/list/index.vue"),
        }
    },
    {
        path:"/register",
        components:{
            header:NavBar,
            default:() =>import("../views/register/index.vue"),
        }
    },
    {
        path:"/detail",
        components:{
            header:NavBar,
            default:() =>import("../views/detail/index.vue"),
        }
    },
]


export default routes
  